<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>今天天气很{{info}}</h2>
      <button @click="isHot = !isHot">切换天气</button>
    </div>

    <script src="./vue.js"></script>
    <script>
      Vue.config.productionTip = false
      const vm = new Vue({
        // el绑定模板
        el: '#app',
        data: {
          isHot: true,
        },
        computed: {
          info() {
            return this.isHot ? '炎热' : '凉爽'
          },
        },
      })
    </script>
  </body>
</html>
